- item ||= f.object
- precision = Nomen::Currency[f.object.sale_currency].precision
%tr.nested-fields{ data: { trade_item: "crediting", currency_precision: precision } }
  %td
    = f.association(:variant, as: :hidden)
    = f.association(:credited_item, as: :hidden)
    %span= f.object.variant.name if f.object.variant
    = f.input_field :compute_from, as: :hidden, data: { compute_from_updater: true }
  %td.decimal
    %span{data: { trade_component: "unit_pretax_amount"}}
      = f.object.unit_pretax_amount.l
    = hidden_field_tag("unit_pretax_amount", data: { trade_component: "unit_pretax_amount"})
  %td.decimal
    = f.input(:credited_quantity, wrapper: :nested, input_html: { size: 7, min: 0, max: f.object.credited_quantity, data: { trade_component: "credited_quantity" }})
  %td.decimal
    = f.association(:tax, as: :hidden)
    = hidden_field_tag("tax_rate", (100 + f.object.tax.usable_amount)/100, data: {value: 'rate', trade_component: "tax"})
    %span= f.object.tax.short_label if f.object.tax
  %td.decimal
    = f.input(:reduction_percentage, as: :hidden, input_html: {data: {trade_component: "reduction_percentage"}})
    = f.object.reduction_percentage.l
  %td.decimal= f.input(:pretax_amount, wrapper: :nested, input_html: { class: "pta", data: { trade_component: "pretax_amount", compute_from: :pretax_amount }})
  %td.decimal= f.input(:amount, wrapper: :nested, input_html: { class: "wta", data: { trade_component: "amount", compute_from: :amount } })
  %td.currency= f.object.sale_currency
  %td.action
    = link_to_remove_association(content_tag(:i) + h(:destroy.ta), f, 'data-no-turbolink' => true, class: 'remove-item')
